Repository navigation
feat(pm-console): Actions stands the Worker up from nothing, and deploys the latest version onto it - #12765
Merged
Conversation
…f-written copy is no copy Found by reading the last three commits of #12723 again after they merged unreviewed. The host's reports are how the edge knows the laptop is there. A report that carries the build is hundreds of kilobytes; on a connection too slow to send it in the twenty seconds a report is given it failed, and the next was built the same way, for as long as the edge lacked the build. Meanwhile nothing arrived, and the edge took the laptop for gone. - A report that carried the build and did not get through (cut off or turned away) is followed at once by one without it; the build is tried again ten minutes later. - A build file that cannot be read is left out the same way instead of stopping the report. - Whether the build and the changed sections fit one report is measured on the report as sent, in bytes. It was estimated in characters, and text outside ASCII is up to three bytes each. - When the build goes alone, the sections it displaced follow at once. - The edge removes the record of its copy before writing a new build over the copy's pieces, so a write that stops half-way cannot leave pieces of two builds to be handed out under the old record, and it removes a larger build's leftover pieces whether or not that record survived. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
…oys the latest version onto it The deploy was one `wrangler deploy`. It is now edge/release.mjs, run by the same workflow, and it starts from whatever is there: 1. no Worker of that name: an empty one is stood up (edge/init: the Durable Object's class and an answer that says it is empty); 2. this commit is uploaded as a version, which serves nothing yet; 3. that version is put at 100%; 4. the Worker is asked which version it is, and if it does not answer as this commit the version that was serving is put back and the run fails. A bad deploy used to stay in service until someone noticed. A new Durable Object migration cannot travel in a version, so then the upload and the promotion are one full deploy. That an account with no Worker needs only this workflow is not taken on trust. Whenever a push changes the release itself, and on a manual run with `scratch`, the same steps first run on pm-console-edge-scratch, which is removed before (so the start is nothing) and after. It is the only Worker the script will delete, and absence of the real one is only believed on two answers that agree. The decisions are in release-plan.mjs and tested; the script is run in the tests against a stand-in for Cloudflare's API and one for wrangler. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was asked
"Stand up an empty worker init using actions, deploy latest version using actions."
What this does
The deploy was one
wrangler deploy. It is nowpm-stack/console/edge/release.mjs, run by the same workflow, and it starts from whatever is there, including nothing:edge/init/: the Durable Object's class, and an answer that says it is empty). A version cannot be uploaded to a Worker that does not exist, and the storage behind the class is only made by a deploy.A new Durable Object migration cannot travel in a version, so then steps 2 and 3 are one full deploy.
The stand-up from nothing is run, not assumed
Whenever a push changes the release itself (
release.mjs,release-plan.mjs,init/,wrangler.jsonc, the lockfile, the workflow), and on a manual run withscratch, the same steps first run onpm-console-edge-scratch: removed before, so the start is nothing; stood up empty and heard to answer as empty; given this commit as a version; heard to answer as this commit; removed again. Merging this pull request is such a push, so the first run after the merge shows it.The real Worker is not touched by the scratch run. Two guards:
The empty Worker answers 503 with
ok: false, so the laptop'sexpose.py, which routes the hostname only to a Worker whose health saysok, can never route to it.Checked
bun test: 177 pass. 21 new: the decisions (release-plan.mjs), and the script itself run against a stand-in for Cloudflare's API and a stand-in for wrangler that records every command: an existing Worker, no Worker, changed classes, a version that never answers (put back), a failed upload, a refusal, answers that disagree, the scratch run, the scratch run failing three ways.wrangler deploy --dry-runfor both configurations andwrangler versions upload --dry-runfor the real one. A test holds the two configurations together on everything that is not a version's own.check-workflows.shwith actionlint and shellcheck) and CI policy check pass.Not checked
The script against the real Cloudflare API. That cannot be done from here; it is what the scratch run on the first push is for. If Cloudflare answers the existence question with a code other than the two expected, that run stops with the code in its log and nothing done, and the real Worker stays on its present version.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.